/**
 *
 */
package cn.hg.jfsa.manage.controller.module.link.validator;

import cn.hg.base.jfinal.validator.BaseValidator;
import com.jfinal.core.Controller;

/**
 * @author Golly
 *
 */
public class LinkValidator extends BaseValidator {

	/* (non-Javadoc)
	 * @see com.jfinal.validate.Validator#validate(com.jfinal.core.Controller)
	 */
	@Override
	protected void validate(Controller c) {
		this.setShortCircuit(true);
		this.validateRequired("link.sortNum", "sortNumMsg", "排序号为必填！");
		this.validateRequired("link.title", "titleMsg", "排序号为必填！");
		this.validateRequired("link.status", "statusMsg", "状态为必填！");

		this.validateString("link.title", 2, 50, "mallLindMsg", "链接必须填写2到50长度的字符！");
		this.validateInteger("link.sortNum", 0, Short.MAX_VALUE, "mallLindMsg", "排序号范围0到65535！");
	}

	/* (non-Javadoc)
	 * @see com.jfinal.validate.Validator#handleError(com.jfinal.core.Controller)
	 */
	@Override
	protected void handleError(Controller c) {
	}

}
